Import SMR Catalogue file
This will import catalogue of SMR job items with costs for a given customer and supplier.
NOTE:
Max allowed file size is 1.1Mb.
Fields
Field Name | Description | Datatype | Validation | Max length | Mandatory | Example |
---|---|---|---|---|---|---|
Supplier | account Id/group Id | string | Valid string | Unlimited | Yes | jBybqdJA9wZQHEmLQDai |
Product | Type of catalogue (This is not required | NA | NA | NA | NA | SMR |
Vehicle Identifier | Unique Id for a vehicle Make & Model | string | Allow any string that consists only of hyphens, plus signs, word characters, and whitespace characters. It will not allow any strings that contain other characters or characters that are not included in the pattern. | Unlimited | No | 12345678 |
Repair Type Id | Unique Id issues by ViSN | string | Allow any string that consists only of hyphens, plus signs, word characters, and whitespace characters. It will not allow any strings that contain other characters or characters that are not included in the pattern. | Unlimited | Yes | 9239238 |
Repair Description | Brief description of the job item | Allow string that consists only of uppercase and lowercase letters, digits, underscores, at symbols, periods, forward slashes, hash symbols, ampersands, plus signs, hyphens, parentheses, square brackets, and double quotes. It will not allow any strings that contain other characters or characters that are not included in the pattern. | (Filters) Fuel ERACFUEL | |||
Make | Vehicle Make | string | Allow any string that consists only of hyphens, plus signs, word characters, and whitespace characters. It will not allow any strings that contain other characters or characters that are not included in the pattern. | Unlimited | Yes | CITROEN |
Model | Vehicle Model | string | Valid string | Unlimited | Yes | GRAND C4 SPACETOURER |
Net Cost | Cost | decimal | valid number | Yes | 45.90 |
Combination of Make, Model, Vehicle Identifier and Repair Id must be unique. The combination of these fields is used to generate document id, for example BMW, SERIES 2, 1300087 and 2220016 generates a key
bmw-series-2-2220016-1300087
Importing a file
Preparation
Create a new branch with Jira task number in the branch name
Delete all the files in importFiles folder
Create a folder with the current sprint number
Copy the file that needs to be imported
Go to
package.json
, find the linevalidate:smrPriceCatalogue
Modify
--leaseId
with the required lease IdModify
--file
with the relative path of the fileSave package.json
Validating locally
in a terminal run
npm run validate:smrPriceCatalogue
If there are no errors, push the code
Validating in workflow
Go to Action of Import-manger
Find
<Environment> - on-demand-import
Select the branch that was created for this import
Enter script name as
validate:smrPriceCatalogue
Leave Overrides empty
Importing the file
If the validation has passed
Go to Action of Import-manger
Find
<Environment> - on-demand-import
Select the branch that was created for this import
Enter script name as
validate:smrPriceCatalogue
Enter
--persist
in Overrides field
Testing
A folder will be created (if not already exists) in Firestore, under the
/accounts/<accountId from the import file>/cataloguePrice/<lease Id from package.json>/smr
New documents will be added in Algolia > smrCatalogueIndex
Status: Accepted
Category: Protected
Authored By: Vishwa on Mar 26, 2023
Revisions.